import request from '@/utils/request';

// 获取订单列表
export const fetchOrderList = (params) => {
    return request({
        url: '/order/list',
        method: 'get',
        params: params
    })
}

// 关闭订单
export const closeOrder = (params) => {
    return request({
        url: '/order/update/close',
        method: 'post',
        params: params
    })
}

// 删除订单
export const deleteOrder = (params) => {
    return request({
        url: '/order/delete',
        method: 'post',
        params: params
    })
}

// 订单交付
export const deliveryOrder = (data) => {
    return request({
        url: '/order/update/delivery',
        method: 'post',
        data: data
    })
}

// 获取订单详情
export const getOrderDetail = (id) => {
    return request({
        url: '/order/' + id,
        method: 'get'
    });
}

// 更新收货人信息
export const updateReceiverInfo = (data) => {
    return request({
        url: '/order/update/receiverInfo',
        method: 'post',
        data: data
    });
}

// 更新订单金额信息
export const updateMoneyInfo = (data) => {
    return request({
        url: '/order/update/moneyInfo',
        method: 'post',
        data: data
    });
}

// 更新订单备注
export const updateOrderNote = (params) => {
    return request({
        url: '/order/update/note',
        method: 'post',
        params: params
    })
}